package com.ykunn.utils.json;

public enum  ResultCode {

    /** 成功 */
    SUCCESS("200", "ok"),

    UPDATE("200", "更新成功"),
    DELETE("200", "删除成功"),
    CREATED("200", "创建成功"),

    NOT_FOUND("404","not found"),

    CONFLICT("409","冲突"),

    METHOD_NOT_ALLOWED("405","method not allowed"),

    no_content("204","no_content"),

    EXCEPTION("401", "发生异常"),

    /** 没有登录 */
    NOT_LOGIN("400", "没有登录"),

    /** 系统错误 */
    SYS_ERROR("402", "系统错误"),

    /** 参数错误 */
    PARAMS_ERROR("403", "参数错误 "),

    /** 不支持或已经废弃 */
    NOT_SUPPORTED("410", "不支持或已经废弃"),

    /** AuthCode错误 */
    INVALID_AUTHCODE("444", "无效的AuthCode"),

    /** 太频繁的调用 */
    TOO_FREQUENT("445", "太频繁的调用"),

    /** 未知的错误 */
    UNKNOWN_ERROR("499", "未知错误");

    private String msg;
    private String code;

    private ResultCode(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getCode(){
        return code;
    }

    public String getMsg(){
        return msg;
    }
}
